#ifndef U2DynLibManager_H
#define U2DynLibManager_H

#include "U2PreRequest.h"
#include "U2Singleton.h"
#include "U2MemoryAllocatorConfig.h"


U2EG_NAMESPACE_BEGIN

class U2DynLib;

class _U2Share U2DynLibManager : public U2Singleton<U2DynLibManager>, public DynLibAlloc
{
protected:
	typedef std::map<U2String, U2DynLib*>		U2DynLibList;
	U2DynLibList		m_libList;

public:
    U2DynLibManager(void);
	virtual ~U2DynLibManager(void);

	static U2DynLibManager&		getSingleton(void);
	static U2DynLibManager*		getSingletonPtr(void);

	U2DynLib*			load(const U2String& filename);
	void				unload(U2DynLib* pLib);
};


U2EG_NAMESPACE_END

#endif